#include "pch.h"

#include "RenderWindow.h"
#include "Pipeline.h"
#include "EntitiesCore.h"
#include "Occluder.h"
#include "ShaderManager.h"

inline void RenderSceneCB				() {
	CameraManager::instance().onRender	();
	engine.frustum.update				();

	Occluder::instance().process		();
	Render								();
}

#ifdef main
#undef main
#endif // main

int main								(int argc, char** argv) {
	InitWindow							();

	const bool render_inited			= InitRender();
	if (!render_inited) {
		fprintf							(stderr, "Render wasn't inited!");
		return							1;
	}

	InitVertexBuffers					();
	InitShaderManager					();

	mainLoopLauncher					(RenderSceneCB);
	SDL_Quit							();

	return								0;
}